<{include file="Public/top.html" }>
	</head>
	<body>
		<div id="warpper">
            <div class="content">
                <div class="location">满员抽奖</div>
                <{include file="./fullNav.html" }>
                <div class="filedSet" style="padding-bottom: 0;">
                    <div class="search">
                        <form action="" id="searchForm" method="get" class="ui-form reportForm">
                            <input name="m" type="hidden" value="<{$module}>">
                            <input name="c" type="hidden" value="<{$controller}>">
                            <input name="a" type="hidden" value="<{$action}>">

                            <input name="p" id="page" type="hidden" value="<{$page|default:1}>">
                            <input name="limit" id="limit" type="hidden" value="<{$limit|default:10}>">

                            <div class="ui-form-item inline-block">
                                <label class="ui-label">时间段</label>
                                <input type="text" name="startDate" id="startDate" value="<{$startDate}>" class="ui-text startDate" readonly/>
                            </div>
                            <div class="ui-form-item inline-block">
                                <label class="ui-label">—&nbsp;&nbsp;&nbsp;</label>
                                <input type="text" name="endDate" id="endDate" value="<{$endDate}>" class="ui-text endDate" readonly/>
                            </div>
                            <div class="ui-form-item inline-block">
                                <label class="ui-label">关键字</label>
                                <input type="text" name="keyword" class="ui-text bg-text keyword"  placeholder="活动名" value="<{$keyword}>"/>
                            </div>
                            <div class="ui-form-item inline-block">
                                <button type="submit" class="ui-button" onclick="LayerShow();">查询</button>
                            </div>
                        </form>
                    </div>
                </div> 
                <!--表格内容-->
                <div class="mainGrid">
                    <table class="ui-table ui-body">
                        <thead>
                            <tr>
                                <th class="pct20">活动名</th>
                                <th class="pct10">用户昵称</th>
                                <th class="pct10">用户姓名</th>
                                <th class="pct10">手机号码</th>
                                <th class="pct20">兑换时间</th>
                                <th class="pct10">兑换数量</th>
                                <th class="pct10">消耗积分</th>
                                <th class="pct10 last-col">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            <{if $list}>
                                <{foreach from=$list item=item}>
                                    <tr>
                                        <td><{$item.title}></td>
                                        <td><{$item.nickname}></td>
                                        <td><{$item.realName}></td>
                                        <td><{$item.bindPhone}></td>
                                        <td><{$item.addTime|date_format:'%Y-%m-%d %T'}></td>
                                        <td><{$item.exchangeNum}></td>
                                        <td><{$item.costPoint}></td>
                                        <td class="ta_l">
                                            <div class="handler">
                                                <a href="javascript:detail('<{$item.id}>')" class="details">详情</a>
                                            </div>
                                        </td>
                                    </tr>
                                <{/foreach}>
                            <{else}>
                                <tr>
                                    <td>没有相关记录</td><td></td><td></td><td></td><td></td><td></td><td></td>
                                </tr>

                            <{/if}>
                        </tbody>
                    </table>
                </div>
                <!--描述：分页-->
                <div class="pagination">
                    <{include file="Public/page.html" }>
                </div>
            </div>
		</div>
        <div style="display:none;">
            <!--详情-->
            <div id="details">
                <div class="form-box border0">
                    <form action="" class="ui-form" id="addManagerForm">
                        <div class="ui-form-item inline-block">
                            <label class="ui-label ui-label-2">姓名：</label>
                            <input type="text" class="ui-text ui-text-2" id="realName" name="realName" placeholder="客户名称" required/>
                        </div>
                        <div class="ui-form-item inline-block">
                            <label class="ui-label">抽奖总参与次数：</label>
                            <input type="text" class="ui-text ui-text-2" id="totalTimes" name="totalTimes" placeholder="4" required/>
                        </div>
                        <div class="ui-form-item inline-block">
                            <label class="ui-label ui-label-2">手机号：</label>
                            <input type="text" class="ui-text ui-text-2" id="bindPhone" name="bindPhone" placeholder="13857234923" required/>
                        </div>
                        <div class="ui-form-item inline-block">
                            <label class="ui-label">抽奖总消耗积分：</label>
                            <input type="text" class="ui-text ui-text-2" id="totalPayPoints" name="totalPayPoints" placeholder="3500" required/>
                        </div>
                        <div class="ui-form-item inline-block">
                            <label class="ui-label ui-label-2">用户标签：</label>
                            <input type="text" class="ui-text ui-text-2" id="userTagHtml" name="userTagHtml" placeholder="注册会员" required/>
                        </div>
                        <div class="ui-form-item inline-block">
                            <label class="ui-label">本次消耗积分：</label>
                            <input type="text" class="ui-text ui-text-2" id="payPoints" name="payPoints" placeholder="2000" required/>
                        </div>
                        <div class="ui-form-item inline-block">
                            <label class="ui-label ui-label-2">用户等级：</label>
                            <input type="text" class="ui-text ui-text-2" id="level" name="level" placeholder="1" required/>
                        </div>
                        <div class="ui-form-item inline-block">
                            <label class="ui-label">中奖次数：</label>
                            <input type="text" class="ui-text ui-text-2" id="lotteryTimes" name="lotteryTimes" placeholder="1" required/>
                        </div>
                        <div class="ui-form-item inline-block">
                            <label class="ui-label ui-label-2">总消费额：</label>
                            <input type="text" class="ui-text ui-text-2" id="totalPayMoney" name="integral" placeholder="2000.00" required/>
                        </div>
                        <div class="ui-form-item inline-block">
                            <label class="ui-label">上次中奖时间：</label>
                            <input id="lastLotteryTime" class="ui-text ui-text-2" type="text" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm:ss'})"/>
                        </div>
                        <div class="ui-form-item inline-block">
                            <label class="ui-label ui-label-2">上次消费时间：</label>
                            <input id="lastPayTime" class="ui-text ui-text-2" type="text" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm:ss'})"/>
                        </div>
                        <div class="ui-form-item inline-block">
                            <label class="ui-label">上次抽奖时间：</label>
                            <input type="text" class="ui-text ui-text-2" id="lastTakeTime" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm:ss'})" />
                        </div>
                    </form>
                </div>
            </div>
		</div>
		<script src="Public/Admin/js/jquery-1.11.0.js"></script>
		<script src="Public/Admin/js/common.js"></script>
		<script src="Public/Admin/js/dialog-min.js"></script>
		<script src="Public/Admin/js/My97DatePicker/WdatePicker.js"></script>
		<script>
			function detail(id){
                $.getJSON("<{U('PointLottery/lotteryInfo')}>",{id:id},function(data){
                    if(data.status){
                        layer.msg(data.msg);
                    } else{
                        $('#realName').val(data['realName']);
                        $('#bindPhone').val(data['bindPhone']);
                        $('#userTagHtml').val(data['userTagHtml']);
                        $('#level').val(data['level']);
                        $('#totalTimes').val(data['totalTimes']);
                        $('#totalPayPoints').val(data['totalPayPoints']);
                        $('#payPoints').val(data['payPoints']);
                        $('#lotteryTimes').val(data['lotteryTimes']);
                        $('#lastTakeTime').val(data['lastTakeTime']);
                        $('#lastLotteryTime').val(data['lastLotteryTime']);
                        $('#lastPayTime').val(data['lastPayTime']);
                        $('#totalPayMoney').val(data['totalPayMoney']);
                        var details = dialog({
                            title: '用户详情',
                            width: 700,
                            content: $("#details")
//                            onshow: function(){
//                                $("#details form")[0].reset();
//                            },
                        });
                        details.showModal();
                    }
                });
			};
            datePickter('startDate','endDate');
		</script>
        <{include file="Public/foot.html" }>
	</body>
</html>
